import React from 'react'

//封装高阶组件实现导航守卫
import {Navigate} from 'react-router-dom'
function Hoc_login(Com) {
  return (props)=>
  {
        let token=localStorage.getItem('token')
        if(token)
        {
            
            return <Com {...props}></Com>
        }
        else
        {
            return <Navigate to='/login'></Navigate>
        }
  }
}

export default Hoc_login